D:/Xampp/htdocs/budget/
│
├── api/
│   ├── budget_plan.php          # Saves monthly planned targets & copies previous month targets
│   ├── categories.php           # CRUD & archive engine for spending categories + ratio pillars
│   ├── debts.php                # CRUD & statement balance adjustments for debt accounts
│   ├── reports.php              # JSON analytics endpoint for monthly & yearly chart data
│   ├── settings.php             # Persists custom strategic ratio split percentages (e.g. 50/30/10/10)
│   └── transactions.php         # Ledger CRUD, AJAX Pending/Cleared toggling, and debt auto-recalc
│
├── assets/
│   └── css/
│       └── style.css            # Custom typography, inputs, sage-green accents, and soft card styling
│
├── classes/
│   ├── BudgetEngine.php         # Analytics engine: sums cleared cash flow, variances, ratios, & debts
│   └── TransactionRepository.php # Database access layer for transactions with rollback safety
│
├── config/
│   └── config.php               # Environment-driven settings, timezone (Asia/KL), and currency (RM)
│
├── db/
│   ├── database.php             # Singleton PDO database connector with strict error modes
│   ├── migration.sql            # Upgrade helper for the original Gemini database
│   └── schema.sql               # Canonical database tables, indexes, constraints, and defaults
│
├── includes/
│   ├── auth_check.php           # Session guard: redirects unauthenticated users to login.php
│   ├── footer.php               # Standard bottom layout container and closing HTML tags
│   ├── header.php               # Top navigation bar, mobile drawer, user session chip, and icons
│   └── security.php             # Hardened sessions, CSRF tokens, request parsing, and validation helpers
│
├── budget_plan.php              # Monthly planned targets setup screen ("yellow cells" equivalent)
├── categories.php               # Category manager: add/edit categories and assign ratio pillars
├── dashboard.php                # Executive overview: KPI cards, Strategic Ratio meters, & variance table
├── debts.php                    # Liability monitor: opening vs. current balance, payoff progress bars
├── index.php                    # Entry point: checks session and routes to dashboard or login
├── login.php                    # User authentication screen
├── logout.php                   # Session teardown and cookie flush
├── register.php                 # Owner account creation screen with password hashing
└── transactions.php             # Transaction ledger view: mobile cards/table and quick-add modal
